package com.sergio.accounting.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 统计数据DTO
 */
@Data
public class StatisticsDTO {

    // 概览数据
    private OverviewDTO overview;
    
    // 趋势数据
    private List<TrendDTO> trend;
    
    // 分类统计
    private List<CategoryStatsDTO> categoryStats;
    
    // 排行榜
    private List<RankingDTO> ranking;

    @Data
    public static class OverviewDTO {
        private BigDecimal totalIncome;
        private BigDecimal totalExpense;
        private BigDecimal balance;
        private Long totalRecords;
        private BigDecimal averageAmount;
        private BigDecimal maxAmount;
        private Integer categoryCount;
        private Integer totalDays;
        private BigDecimal avgDailyExpense;
    }

    @Data
    public static class TrendDTO {
        private String date;
        private BigDecimal income;
        private BigDecimal expense;
        private BigDecimal balance;
    }

    @Data
    public static class CategoryStatsDTO {
        private Long categoryId;
        private String categoryName;
        private String categoryIcon;
        private BigDecimal amount;
        private BigDecimal percentage;
        private String color;
    }

    @Data
    public static class RankingDTO {
        private String categoryName;
        private String categoryIcon;
        private BigDecimal amount;
        private Integer rank;
    }
}
